<template>
    <div>{{ count }}</div>
    <button @click="increment">+</button>
</template>
<script lang='ts' setup>
import {ref,watch} from 'vue'
let count=ref<number>(0)
const increment=()=>{
    count.value++
    count.value++
    count.value++
    count.value++
}
watch(count,(newval,oldval)=>{
    console.log('**************',newval,oldval); 
},{
    flush:'sync'
})
</script>
<style lang='scss' scoped>
</style>